import request from '@/utils/request'
import qs from 'qs'

export function addVideoApi(form) {
  return request({
      url: `/video`,
      data: form,
      method: 'post'
  })
}

export function getVideoApi(id) {
  return request({
    url: `/video/${id}`,
    method: 'get'
  })
}
export function getVideosApi(pageNo, pageSize, video) {
  return request({
    url: `/video?${qs.stringify(video)}`,
    params:{
      pageNo: pageNo,
      pageSize: pageSize,
    },
    method: 'get'
  })
}

export function delVideoApi(id) {
  return request({
    url: `/video/${id}`,
    method: 'delete',
  })
}
export function delVideosApi(videos) {
  return request({
    url: `/video`,
    data:videos,
    method: 'delete'
  })
}
export function updateVideoApi(form) {
  return request({
    url: `/video`,
    method: 'put',
    data:form
  })
}
